export default {
  onParameterUpdate: function(self, ctx, key, value) {
    if (key === 'SetCamera') {
      const object = ctx.SCENE_MANAGER.active.of(value);
      if (!object) {
        console.log(`No such GameObject: ${value}`);
        return;
      }
      const component = object.getComponent('CameraComponent');
      if (!component) {
        console.log(`GameObject ${value} doesn't have CameraComponent.`);
        return;
      }
      ctx.CAMERA_MANAGER.use(component.camera.uuid);
    }
  }
}